Multiples of 3 and 5
Find the sum of all the multiples of 3 or 5 below 1000.
Plan:
In order to figure out the sum, we need to add up all of the
numbers below 1000 that are multiples of either 3 or 5.
Pseudocode:
- set the intial number to 0
- intialize the sum to 0
- intialize a counter to 0
- create a loop that goes to 1000
- add numbers to the sum that are divisable by either 3 or 5
- print out the sum
Solution:
Link to home page